package com.kanshu.ksgb.fastread.doudou.module.book.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.kanshu.ksgb.fastread.doudou.app.constants.ARouterConfig;
import com.kanshu.ksgb.fastread.doudou.base.baseui.BaseActivity;
import com.kanshu.ksgb.fastread.doudou.module.book.fragment.SubCategoryFragment;
import com.umeng.analytics.MobclickAgent;

/**
 * Created by wcy on 2017\7\17 0017.
 */
@Route(path = ARouterConfig.SUB_CATEGORY_LIST)
public class SubCategoryListActivity extends BaseActivity {
    public static final String EXTRA_TITLE = "title";
    public static final String EXTRA_CATEGORY_ID_1 = "category_id_1";
    public static final String EXTRA_CATEGORY_ID_2 = "category_id_2";
    public static final String EXTRA_SITE = "site";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String title = getIntent().getStringExtra(EXTRA_TITLE);
        String mCategoryId1 = getIntent().getStringExtra(EXTRA_CATEGORY_ID_1);
        String mCategoryId2 = getIntent().getStringExtra(EXTRA_CATEGORY_ID_2);
        String site = getIntent().getStringExtra(EXTRA_SITE);
        SubCategoryFragment fragment = SubCategoryFragment.newInstance(mCategoryId1, mCategoryId2, site);
        showFragment(fragment, "subcategory");
        setTitle(title);
    }
    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
        MobclickAgent.onPageStart(getClass().getSimpleName());
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
        MobclickAgent.onPageEnd(getClass().getSimpleName());
    }
}
